<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('strator_upload_logs', function (Blueprint $table) {
            $table->id();

            $table->unsignedInteger('strator_id')->index()->comment('管理员id');
            $table->string('original_name')->nullable()->comment('上传文件原始名称');
            $table->string('local_url')->nullable()->comment('本地地址');
            $table->string('cloud_url')->nullable()->comment('云存储地址');
            $table->char('file_type',32)->index()->nullable()->comment('文件类型：image,video,audio,file');

            $table->timestamps();
            $table->softDeletes();
        });

        \DB::statement("ALTER TABLE `strator_upload_logs` comment '管理员上传记录表'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('strator_upload_logs');
    }
};
